home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 750 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.1 KB

  1. Path: cs.umd.edu!gilman
  2. From: gilman@cfar.umd.edu (Gil Carmel)
  3. Newsgroups: comp.lang.c++
  4. Subject: Template Class Linkage?
  5. Date: 6 Jan 1996 20:55:24 GMT
  6. Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
  7. Message-ID: <4cmnjs$mk7@mimsy.cs.umd.edu>
  8. NNTP-Posting-Host: scribble.cfar.umd.edu
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. Hi,
  12.  
  13. I'm just learning templates, and I'm having problems with linkage.
  14. When the template class member function bodies are included in the ".h" file,
  15. everything is fine.  But when the function bodies are in a separate ".c" file,
  16. calls to these functions from other files give an "undefined reference to
  17. function" error from the linker.  Do template class member functions have 
  18. to be in the ".h" file, or is this a problem with my compiler?
  19.  
  20. Thanks for any help,
  21. Gil
  22.  
  23. --
  24. |-----------------------------------------------------------|
  25. | Gil Carmel             | gilman@wam.umd.edu        |
  26. | Computer Science Undergraduate | gilman@cfar.umd.edu        |
  27. | University of Maryland     |                |
  28. | College Park, MD         |                |
  29. |-----------------------------------------------------------|
  30. | |                \o              | |
  31. | |                 |\              | |
  32. | |                / \              | |
  33.